#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;


void test1()
{
	/*int a = 10, b = 20;
	auto swap1 = [a, b]()mutable {
		int t = a;
		a = b;
		b = t;
	};
	swap1();
	cout << a << endl;
	cout << b << endl;*/
	/*int a = 10, b = 20;
	auto swap1 = [&a, &b] {
		int t = a;
		a = b;
		b = t;
	};
	swap1();
	cout << a << endl;
	cout << b << endl;*/
	//int a = 1, b = 2, c = 3;
	//auto add = [=] ()mutable{
	//	a++;
	//	return a + b + c;
	//};
	//cout << add() << endl;// 7
	//cout << a << endl;// 1
	//int a = 1, b = 2, c = 3;
	//auto add = [&] {
	//	a++;
	//	return a + b + c;
	//};
	//cout << add() << endl;// 7
	//cout << a << endl;// 2
	
}
void test2()
{
	
	
}
//int main()
//{
//	/*test1();
//	test2();*/
//
//	return 0;
//}

class A
{
public:
	A(int a)
		:_a(a)
	{}
	void Func()
	{
		auto func = [this]() {
			cout << _a << endl;// 10
		};
		func();
	}
private:
	int _a;
};

int main()
{
	A aa(10);
	aa.Func();
	return 0;
}